Resources and References

Python Django

Django API

Django REST API Token

## Create Token
./manage.py drf_create_token <username>

## regenerate token
./manage.py drf_create_token -r <username>

Django Pagination

Ansible Runner

ansible-runner -p my_playbook.yml run /path/to/my/project
import ansible_runner
r = ansible_runner.run(private_data_dir='/tmp/demo', playbook='test.yml')
print("{}: {}".format(r.status, r.rc))
# successful: 0
for each_host_event in r.events:
    print(each_host_event['event'])
print("Final status:")
print(r.stats)

Passing inventory to ansible runner

The ansible_runner.run() accepts following values for inventory parameter.

  1. Path to the inventory file in the private_data_dir
  2. Native python dict supporting the YAML/json inventory structure
  3. A text INI formatted string
  4. A list of inventory sources, or an empty list to disable passing inventory

Default value, if not passed, for this parameter is private_data_dir/inventory directory. Passing this parameter overrides the inventory directory/file.

Jekyll inside a container

Docker/Podman/Kuebrnetes

podman run –rm
–volume=”$PWD:/srv/jekyll:Z”
-p 4000:4000
jekyll/jekyll
jekyll serve

podman run -dt -p 32080:8000/tcp localhost/openguard-doc